Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ord of cmp_fix #12471

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Fix Ord of cmp_fix #12471

merged 1 commit into from
Jul 23, 2024

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Jul 23, 2024

Summary

Fixes #12469

Test Plan

Running ruff with the given test snipped no longer panics when using rust nightly

Okay, I think the problem is the first return that higher prioritizes UnusedImport. The problem is that it violates

< is transitive: a < b and b < c implies a < c. The same must hold for both == and >.

Let's say we have

  • a: RedefinedWhileUnused with a min fix of 100
  • b: UnusedImport with a min fix of 0
  • c: any other rule with a min fix of 5

then:

@MichaReiser MichaReiser added the bug Something isn't working label Jul 23, 2024
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser merged commit 3af6ccb into main Jul 23, 2024
20 checks passed
@MichaReiser MichaReiser deleted the fix-ord branch July 23, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ord violation panic when fixing file with nightly compiler
2 participants